package com.tyk.bookstore.back.system.model.query;

import com.tyk.bookstore.back.common.core.model.type.Gender;
import com.tyk.bookstore.back.common.core.valid.annotation.CommonFieldValid;
import com.tyk.bookstore.back.common.core.valid.type.CommonFieldValidType;
import com.tyk.bookstore.back.system.valid.annotation.UserFieldValid;
import com.tyk.bookstore.back.system.valid.type.UserFieldValidType;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.util.Set;

@Data
public class UserAddQuery {

    @Schema(description = "用户密码")
    @NotBlank
    @UserFieldValid(UserFieldValidType.PASSWORD)
    private String password;

    @Schema(description = "用户姓名")
    @NotBlank
    @CommonFieldValid(CommonFieldValidType.PERSON_NAME)
    private String name;

    @Schema(description = "用户年龄")
    @NotNull
    @CommonFieldValid(CommonFieldValidType.AGE)
    private Integer age;

    @Schema(description = "用户性别")
    @NotNull
    private Gender gender;

    @Schema(description = "手机号码")
    @NotBlank
    @CommonFieldValid(CommonFieldValidType.PHONE)
    private String phone;

    @Schema(description = "电子邮箱")
    @NotBlank
    @CommonFieldValid(CommonFieldValidType.EMAIL)
    private String email;

    @Schema(description = "身份证号")
    @NotBlank
    @CommonFieldValid(CommonFieldValidType.ID_CARD)
    private String idCard;

    @Schema(description = "角色ID列表")
    @NotNull
    private Set<Long> roleIdList;
}
